from django.db import models
from users.models import User
# Create your models here.

class forum(models.Model):
    head = models.ImageField(upload_to="static/userhead/",verbose_name='头像')
    name = models.CharField(max_length=50,verbose_name='名字')
    content = models.TextField(verbose_name='内容')
    datatime = models.DateTimeField(auto_now=True, verbose_name='时间')
    user = models.ForeignKey(User,on_delete=models.CASCADE)

    def __str__(self):
        return self.name
    class Meta:
        verbose_name_plural='留言'